package leetcode.code1460;

import java.util.Arrays;

public class Solution4 {

	public boolean canBeEqual(int[] target, int[] arr) {
		int[] cnts = new int[1001];
		for (int i = 0; i < arr.length; i++) {
			cnts[target[i]]++;
			cnts[arr[i]]--;
		}
		for (int i = 0; i < cnts.length; i++) {
			if (cnts[i] != 0) {
				return false;
			}
		}
		return true;
	}

}
